package com.dfbz.controller.dept;

import com.dfbz.controller.BaseServlet;
import com.dfbz.service.DeptService;
import com.dfbz.service.impl.DeptServiceImpl;

import javax.servlet.ServletContext;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

@WebServlet("/dept/*")
public class DeptServlet extends BaseServlet {
    DeptService deptService=new DeptServiceImpl();
    public void look_dept(HttpServletRequest req, HttpServletResponse resp){
        try {
            List<Map<String, Object>> all = deptService.findAll();
            req.getSession().setAttribute("depts",all);
            req.getRequestDispatcher("/view/location/department").forward(req,resp);
            return;
        }catch (Exception e){

        }
    }
}
